/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.time.LocalDate;

/**
 * <p>Project: jse2302 - Ex2
 * <p>Powered by webrx On 2023-06-12 17:19:46
 * <p>Created by IntelliJ IDEA
 *
 * @author  webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex4 {
    public static void main(String[] args) {
        var y = 2023;
        var m = 2;
        var d = switch (m) {
            case 4, 6, 9, 11 -> 30;
            case 2 -> LocalDate.of(y, m, 1).isLeapYear() ? 29 : 28;
            default -> 31;
        };
        System.out.printf("%d年%d月有%d天%n",y,m,d);
    }
}
